﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace LongNet.Config
{
    /// <summary>
    /// Exception during app configuration.
    /// </summary>
    [Serializable]
    public class AppConfigException : ApplicationException
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AppConfigException"/> class.
        /// </summary>
        public AppConfigException() { }

        /// <summary>
        /// Initializes a new instance of the <see cref="AppConfigException"/> class with 
        /// a specified error message.
        /// </summary>
        /// <param name="message">A message that describes the error.</param>
        public AppConfigException(string message) : base(message) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="AppConfigException"/> class with 
        /// a specified error message and a reference to the inner exception that is 
        /// the cause of this exception.
        /// </summary>
        /// <param name="message">A message that describes the error.</param>
        /// <param name="innerException">The exception that is the cause of the current exception. If the innerException 
        /// parameter is not a null reference, the current exception is raised in a catch 
        /// block that handles the inner exception.</param>
        public AppConfigException(string message, Exception innerException) : base(message, innerException) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="AppConfigException"/> class with 
        /// serialized data.
        /// </summary>
        /// <param name="info">The object that holds the serialized object data.</param>
        /// <param name="context">The contextual information about the source or destination.</param>
        protected AppConfigException(SerializationInfo info, StreamingContext context) : base(info, context) { }

    }
}
